package com.hsource.doctorcenter.util.enums;

/**
 * @author yangYang
 * @version 1.0
 * @date 2020/10/17 21:19
 * @describe 关闭回调枚举
 */
public enum CloseCallBackEnum {
    /**
     * 定向电话关闭回调
     */
    close("close","ProblemCallBackService"),
    /**
     * 定向电话退款回调
     */
    refund("refund","ProblemCallBackService"),
    /**
     * 定向电话关闭回调
     */
    phone_close("phone_close","DirectedPhoneCallBackService"),
    /**
     * 定向电话退款回调
     */
    phone_refund("phone_refund","DirectedPhoneCallBackService"),
    /**
     * 快捷电话关闭回调
     */
    fast_phone_close("fast_phone_close","FastPhoneCallBackService"),
    /**
     * 快捷电话退款回调
     */
    fast_phone_refund("fast_phone_refund","FastPhoneCallBackService");

    /**
     * 编码
     */
    private String code ;
    /**
     * 实现方式
     */
    private String serviceImpl ;

    /**
     * 根据编码获取实现方式
     * @param code
     * @return
     */
    public static String getServiceImpl(String code) {
        for (CloseCallBackEnum c : CloseCallBackEnum.values()) {
            if (c.getCode().equals(code) ) {
                return c.serviceImpl;
            }
        }
        return null;
    }

    /**
     * 构造
     * @param code
     * @param serviceImpl
     */
    CloseCallBackEnum(String code, String serviceImpl){
        this.code = code;
        this.serviceImpl = serviceImpl;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getServiceImpl() {
        return serviceImpl;
    }

    public void setServiceImpl(String serviceImpl) {
        this.serviceImpl = serviceImpl;
    }
}
